using System;
using System.Windows;
using System.Windows.Media;
namespace Microsoft.Phone.Controls
{
	public class GestureEventArgs : EventArgs
	{
		protected Point GestureOrigin
		{
			get;
			private set;
		}
		protected Point TouchPosition
		{
			get;
			private set;
		}
		public object OriginalSource
		{
			get;
			internal set;
		}
		public bool Handled
		{
			get;
			set;
		}
		internal GestureEventArgs(Point gestureOrigin, Point position)
		{
			this.GestureOrigin = gestureOrigin;
			this.TouchPosition = position;
		}
		public Point GetPosition(UIElement relativeTo)
		{
			return GestureEventArgs.GetPosition(relativeTo, this.TouchPosition);
		}
		protected static Point GetPosition(UIElement relativeTo, Point point)
		{
			if (relativeTo == null)
			{
				relativeTo = Application.get_Current().get_RootVisual();
			}
			if (relativeTo != null)
			{
				GeneralTransform inverse = relativeTo.TransformToVisual(null).get_Inverse();
				return inverse.Transform(point);
			}
			return point;
		}
	}
}
